# -*- coding: utf-8 -*-
"""
@author: bijiahao
@date: 2025/10/20 17:42
@description:
"""
from fastmcp import FastMCP

mcp = FastMCP("Weather-SSE", port=8001)


@mcp.tool()
def get_weather(city: str) -> str:
    """获取城市当前天气（mock）"""
    return f"{city} 今天晴，25℃，适合出行。"


@mcp.resource("weather://cities")
def list_cities() -> str:
    return "北京,上海,广州,深圳"


if __name__ == "__main__":
    mcp.run(transport="sse")
    # mcp.run(transport="http")
